Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Export CSV] Export data stored in new proto-based format #1917

Merged
merged 66 commits into from
Aug 6, 2024

Conversation

gino-m
Copy link
Collaborator

@gino-m gino-m commented Jul 17, 2024

Towards #1779.

One merged, I'll send a separate PR to read the Survey metadata in the new proto format when exporting.

@gino-m gino-m marked this pull request as ready for review August 5, 2024 20:53
sufyanAbbasi
sufyanAbbasi previously approved these changes Aug 5, 2024
Copy link
Contributor

@sufyanAbbasi sufyanAbbasi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just nits and some interesting db/client sync questions with the proto changes. Otherwise, LGTM!

response: Pb.TaskData.IDateTimeResponse
): string | null {
const seconds = response.dateTime?.seconds;
if (seconds === undefined || seconds === null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seconds != null

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What did you mean here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I should have been more clear! There's a funny quirk language feature that allows you to check for both null and undefined with non-strict equality like this:
https://stackoverflow.com/a/16607837

I personally think that it's better to not explicitly check for both null and undefined unless the specifications of the object explicitly define null and undefined to represent different states (which is the 1% case), and opt for simpler, cleaner code to help JS hide it's mistake of putting in TWO nulls in its language ahah.

@@ -40,4 +39,7 @@ message AuditInfo {

// URL of the user's profile picture.
string photo_url = 5;

// The user's email address.
string email_address = 6;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should note that we will need to fix the app client to address this, since we were storing and querying by user_id, which may constitute a large/breaking change...

Can you file a bug on the Android side and I can quickly get this fixed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Querying for what, exactly? Ad hoc LOIs? If so, wouldn't that continue to work, since this is just an additive change?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh... I must have gotten the Survey's ACL field confused with AuditInfo. I think we should be ok! We'll just want to make sure we're clear which field is meant to be the primary key etc.

Copy link
Collaborator Author

@gino-m gino-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sufyanAbbasi All comments resolved, modulo two follow-up questions. PTAL?

@@ -40,4 +39,7 @@ message AuditInfo {

// URL of the user's profile picture.
string photo_url = 5;

// The user's email address.
string email_address = 6;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Querying for what, exactly? Ad hoc LOIs? If so, wouldn't that continue to work, since this is just an additive change?

sufyanAbbasi
sufyanAbbasi previously approved these changes Aug 6, 2024
response: Pb.TaskData.IDateTimeResponse
): string | null {
const seconds = response.dateTime?.seconds;
if (seconds === undefined || seconds === null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I should have been more clear! There's a funny quirk language feature that allows you to check for both null and undefined with non-strict equality like this:
https://stackoverflow.com/a/16607837

I personally think that it's better to not explicitly check for both null and undefined unless the specifications of the object explicitly define null and undefined to represent different states (which is the 1% case), and opt for simpler, cleaner code to help JS hide it's mistake of putting in TWO nulls in its language ahah.

@@ -40,4 +39,7 @@ message AuditInfo {

// URL of the user's profile picture.
string photo_url = 5;

// The user's email address.
string email_address = 6;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh... I must have gotten the Survey's ACL field confused with AuditInfo. I think we should be ok! We'll just want to make sure we're clear which field is meant to be the primary key etc.

sufyanAbbasi
sufyanAbbasi previously approved these changes Aug 6, 2024
Copy link
Contributor

@sufyanAbbasi sufyanAbbasi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much!!

Copy link
Contributor

@sufyanAbbasi sufyanAbbasi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you++! Sorry we had to modify the linter to satisfy the odd hills I want to die on haha

@gino-m gino-m merged commit c56bb79 into master Aug 6, 2024
7 checks passed
@gino-m gino-m deleted the gino-m/1779/export-csv-from-pb-data branch August 6, 2024 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants